package com.example.blockbreaker;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;

import java.util.List;

@Dao
public interface HealthDataDao {
    @Insert
    void insert(HealthData healthData);

    @Query("SELECT * FROM health_data ORDER BY timestamp DESC")
    LiveData<List<HealthData>> getAll();

    @Query("SELECT * FROM health_data ORDER BY timestamp DESC LIMIT 1")
    LiveData<HealthData> getLatest();
}